package testClasses.misc;

import gameAppLayer.AssetPreLoader;
import gameAppLayer.ExternalData;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import com.jme3.asset.AssetKey;

import testClasses.ATest;
import testClasses.TestingSystem;
import utilities.ExternalDataLoader;

public class AssetPreLoaderTest extends ATest {

	public AssetPreLoaderTest(TestingSystem system) {
		super(system);
		this.name = "AssetPreLoaderTest";
	}

	@Override
	public boolean execute() throws FileNotFoundException, IOException,
			ClassNotFoundException {
		
		//load ExternalData
		ExternalDataLoader loader = new ExternalDataLoader();
		loader.execute();
		ExternalData data = loader.getData();
		
		AssetPreLoader assetLoader = new AssetPreLoader(assetManager, data);
		boolean check = assetLoader.init();
		
		HashMap<String, AssetKey> keyMap = assetLoader.getMaterialMap();
		
		for (Map.Entry<String, AssetKey> entry : keyMap.entrySet()) {
			System.out.println(entry.getKey());
			System.out.println(entry.getValue().toString());
			//System.out.println(entry.getValue().getFolder());
			
			
			//System.out.println(entry.getKey() + ": " + entry.getValue().getFolder()+entry.getValue().getName());			
		}
		
		
		
		return true;
	}

}
